Skip to content

chore(stovepipe): set up dlv debugging setup in container#307

Merged
behinddwalls merged 1 commit into
mainfrom
mnoah1/debug-setup
Jul 7, 2026
Merged

chore(stovepipe): set up dlv debugging setup in container#307
behinddwalls merged 1 commit into
mainfrom
mnoah1/debug-setup

Conversation

@mnoah1

@mnoah1 mnoah1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why?

Provide a configuration to get breakpoint debugging working locally

What?

Adjust Makefile with an additional local-stovepipe-debug-start. This builds a debug binary and starts it inside a container with dlv. Includes a .vscode/launch.json configuration to attach to it.

Test Plan

 % make local-stovepipe-debug-start                                                                             
Building Stovepipe Linux debug binary for Docker...
INFO: Invocation ID: bbd58a95-06b5-4cd7-9e57-dc5395bff6ab
INFO: Analyzed target //service/stovepipe/server:stovepipe (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //service/stovepipe/server:stovepipe up-to-date:
  bazel-bin/service/stovepipe/server/stovepipe_/stovepipe
INFO: Elapsed time: 0.201s, Critical Path: 0.00s
INFO: 1 process: 1 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
Stovepipe Linux debug binary ready at .docker-bin/stovepipe-debug
Starting Stovepipe service with compose (debug)...
[+] Building 0.9s (15/15) FINISHED                                                                                       
 => [internal] load local bake definitions                                                                          0.0s
 => => reading from stdin 576B                                                                                      0.0s
 => [internal] load build definition from Dockerfile.debug                                                          0.0s
 => => transferring dockerfile: 665B                                                                                0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm-slim                                             0.0s
 => [internal] load metadata for docker.io/library/golang:1.24-bookworm                                             0.3s
 => [internal] load .dockerignore                                                                                   0.0s
 => => transferring context: 2B                                                                                     0.0s
 => [dlv 1/2] FROM docker.io/library/golang:1.24-bookworm@sha256:1a6d4452c65dea36aac2e2d606b01b4a029ec90cc1ae53890  0.0s
 => [stage-1 1/5] FROM docker.io/library/debian:bookworm-slim                                                       0.0s
 => [internal] load build context                                                                                   0.2s
 => => transferring context: 21.20MB                                                                                0.2s
 => CACHED [stage-1 2/5] RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*    0.0s
 => CACHED [dlv 2/2] RUN go install github.com/go-delve/delve/cmd/dlv@v1.24.2                                       0.0s
 => CACHED [stage-1 3/5] COPY --from=dlv /go/bin/dlv /usr/local/bin/dlv                                             0.0s
 => CACHED [stage-1 4/5] WORKDIR /root/                                                                             0.0s
 => CACHED [stage-1 5/5] COPY .docker-bin/stovepipe-debug ./stovepipe                                               0.0s
 => exporting to image                                                                                              0.0s
 => => exporting layers                                                                                             0.0s
 => => writing image sha256:a44246269b1d261c3abd7cde3c10922933786c3df65d9ab52edbac4c221627f5                        0.0s
 => => naming to docker.io/library/stovepipe-stovepipe-service                                                      0.0s
 => resolving provenance for metadata file                                                                          0.0s
WARN[0001] Found orphan containers ([stovepipe-gateway-service-1 stovepipe-orchestrator-service-1]) for this project. Ifyou removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 4/4
 ✔ stovepipe-stovepipe-service              Built                                                                   0.0s 
 ✔ Container stovepipe-mysql-app-1          Healthy                                                                 1.0s 
 ✔ Container stovepipe-mysql-queue-1        Healthy                                                                 1.0s 
 ✔ Container stovepipe-stovepipe-service-1  Healthy                                                                 1.0s 
Applying storage and queue schemas...
Applying storage schema to mysql-app...
  - Applying request.sql...
  - Applying request_uri.sql...
Applying queue schema to mysql-queue...
  - Applying queue_delivery_state.sql...
  - Applying queue_messages.sql...
  - Applying queue_offsets.sql...
  - Applying queue_partition_leases.sql...
  - Applying queue_subscriber_heartbeats.sql...
✅ Stovepipe schemas applied successfully

✅ Stovepipe debug is running (delve :2345)!

NAME                            IMAGE                         COMMAND                  SERVICE             CREATED   STATUS                    PORTS
stovepipe-mysql-app-1           mysql:8.0                     "docker-entrypoint.s…"   mysql-app           14 minutes ago   Up 14 minutes (healthy)   33060/tcp, 0.0.0.0:32777->3306/tcp, [::]:32777->3306/tcp
stovepipe-mysql-queue-1         mysql:8.0                     "docker-entrypoint.s…"   mysql-queue         14 minutes ago   Up 14 minutes (healthy)   33060/tcp, 0.0.0.0:32778->3306/tcp, [::]:32778->3306/tcp
stovepipe-stovepipe-service-1   stovepipe-stovepipe-service   "dlv exec ./stovepip…"   stovepipe-service   41 minutes ago   Up 41 minutes             0.0.0.0:2345->2345/tcp, [::]:2345->2345/tcp, 0.0.0.0:32776->8080/tcp, [::]:32776->8080/tcp

Stovepipe gRPC port: 32776
Delve: 127.0.0.1:2345 — run launch config "Debug: attach (dlv in docker)"

  • Send a request (e.g. grpcurl -plaintext -d '{"queue":"monorepo/main"}' localhost:32776 uber.submitqueue.stovepipe.Stovepipe/Ingest and ensure the service stops at a breakpoint

@mnoah1 mnoah1 marked this pull request as ready for review July 7, 2026 16:26
@mnoah1 mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners July 7, 2026 16:26
@behinddwalls behinddwalls added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit 49c4393 Jul 7, 2026
27 checks passed
@behinddwalls behinddwalls deleted the mnoah1/debug-setup branch July 7, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants